package forward.Module.Modules.Move;

import forward.api.Events.Render.EventRender2D;
import forward.api.Value.Option;
import org.lwjgl.input.Keyboard;

import forward.api.EventHandler;
import forward.api.Events.World.EventPreUpdate;
import forward.Module.Module;
import forward.Module.ModuleType;

import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.settings.KeyBinding;

public class InvMove extends Module {

	//private Option Jump = new Option("Jump", "Jump", true);
	private Option<Boolean> Jump = new Option<>("Jump", "Jump", true);
	private Option<Boolean> Sneak = new Option<>("Sneak", "Sneak", false);

	public InvMove() {
		super("InvMove", new String[]{}, ModuleType.Move);
		this.addValues(Jump, Sneak);
	}

	@EventHandler
	public void onRender2D(EventRender2D event) {
		if (mc.currentScreen != null && !(mc.currentScreen instanceof GuiChat)) {
			mc.gameSettings.keyBindForward.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode()));
			mc.gameSettings.keyBindBack.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode()));
			mc.gameSettings.keyBindLeft.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()));
			mc.gameSettings.keyBindRight.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()));
			if (Jump.getValue() == true) {
				mc.gameSettings.keyBindJump.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode()));

			}
			if (Sneak.getValue() == true) {
				mc.gameSettings.keyBindSneak.pressed = (Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode()));

			}

		}
	}
}
